package com.lgl.controller;

import com.lgl.annotation.InterfaceNum;
import com.lgl.entity.ResponseResult;
import com.lgl.service.EmailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class EmailController {
    @Autowired
    private EmailService emailService;
    @InterfaceNum(seconds = 60,maxcount = 5)
    @PostMapping("/sendemail")
    public ResponseResult sendEmail(String email){
       return emailService.sendEmail(email);
//        return ResponseResult.okResult();
    }
}
